<template lang="html">
  <div class="registerShop">

      <el-col :xs="24" :sm="{span:20,offset:0}" :md="{span:20,offset:0}" :lg="{span:16,offset:0}" class="consumer-main">
        <el-steps :space="120" :center="true"  :align-center="true" :active="active" >
        <el-step title="基本信息"></el-step>
        <el-step title="银行卡信息"></el-step>
        <el-step title="上传资料"></el-step>

        </el-steps>
        <el-col :span="14" :offset="5">

            <router-view></router-view>
            <el-col :span="14" :offset="5">
              <el-button @click="old">上一步</el-button>
              <el-button v-show="!isb" @click="next">下一步</el-button>
              <el-button v-show='isb' @click="ok">完成</el-button>
              </el-col>
        </el-col>
      </el-col>



  </div>

</template>

<script>
export default {
    data() {
        return {
            active: 1,
            isb: false,
            ist: [true, false, false, false, false],
            hrefArr: ["/home/registerShop/shopBasic", "/home/registerShop/shopBank", "/home/registerShop/shopUploading"],
            i: 0
        }
    },
    components: {

    },
    methods: {
        next() {
            if (this.$route.path != this.hrefArr[this.i]) {
                for (let i = 0; i < this.hrefArr.length; i++) {
                    if (this.hrefArr[i] == this.$route.path) {
                        this.i = i
                        this.active = i
                        console.log("判断到当前位置有异常" + this.i);

                    }
                }
            }

            //步骤条 下一步
            this.active++
                if (this.active >= 3) {
                    this.isb = true;
                    this.active = 3



                }

            if (this.i++ >= 2) {
                this.i = 2

            }




            this.$router.push(this.hrefArr[this.i])


        },
        old() {

            //步骤条 上一步
            if (this.active == 3) {
                this.isb = false

            }
            if (this.i-- <= 0) {
                this.i = 0
            }
            if (this.active-- <= 0) {
                this.active = 0

            }

            this.$router.push(this.hrefArr[this.i])
        },
        ok() {
            this.$router.push('/user/shopCommon')
        }
    }
}
</script>

<style lang="css">
.consumer-main{
  height: 900px;
  margin-top: 20px;
  background-color: #fff;

}
</style>
